/**
 *  @file IntCheck.h
 */
#ifndef _INTCHECK_H_
#define _INTCHECK_H_

#include "../common/commontypes.h"

namespace cppflib
{

namespace lang
{

typedef enum _arithop
{
   AOP_ADD,
   AOP_SUB,
   AOP_MUL
} arithop_t;

_DLLAPI bool CheckOverflow(arithop_t op, int a, int b); 
_DLLAPI bool CheckOverflow(arithop_t op, u32_t a, u32_t b); 
_DLLAPI bool CheckOverflow(arithop_t op, i64_t a, i64_t b);
_DLLAPI bool CheckOverflow(arithop_t op, u64_t a, u64_t b);

/**
 *  Return value of TestNumType
 */
typedef enum _numbertype
{
   NUMT_UNKNOWN,
   NUMT_SINT32,          ///< signed 32 bit integer
   NUMT_SINT64,          ///< signed 64 bit integer
   NUMT_SINT64OVERFLOW,  ///< overflow signed 64 bit integer
   NUMT_DOUBLE,          ///< double
} numbertype_t;

_DLLAPI numbertype_t CheckNumType(pcwstr_t str);

}  // end of namespace lang

}  // end of namespace cppflib

#endif
